const axios = require("axios");
// const requestData = async (idx, job) => {
//   let data = {
//     model: "concise",
//     messages: [
//       {
//         role: "user",
//         content: `给我写一篇400字左右的实习${job}岗位的周志,这周为第${idx}周,不要有任何ai的痕迹`,
//       },
//     ],
//     stream: false,
//   };
//   let response = await axios.post(
//     "http://localhost:8000/v1/chat/completions",
//     data,
//     {
//       headers: {
//         Authorization:
//           "Bearer 66a1f3bd700edf044900cfb8-6af7c8d7b1fd44848000a599435161ab",
//       },
//     }
//   );
//   console.log(response, "222222");

//   return response;
// };

// module.exports = { requestData };

async function test() {
  let data = {
    model: "concise",
    messages: [
      {
        role: "user",
        content: `给我写一篇400字左右的实习web岗位的周志,这周为第1周,不要有任何ai的痕迹`,
      },
    ],
    stream: false,
  };
  let response = await axios.post(
    "http://localhost:8000/v1/chat/completions",
    data,
    {
      headers: {
        Authorization:
          "Bearer 66a1f3bd700edf044900cfb8-6af7c8d7b1fd44848000a599435161ab",
      },
    }
  );
  console.log(response.data.choices[0].message.content);
}
test();
